<template>
  <el-table :data="list">
    <el-table-column label="工单" prop="name" />
    <el-table-column label="设备" prop="equipment.name" />
  </el-table>
</template>

<script>
import API from '@/api/maintain/wordorder'
export default {
  name: 'LocationWordorder',
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      list: []
    }
  },
  watch: {
    value() {
      this.index()
    }
  },
  created() {
    this.index()
  },
  methods: {
    index() {
      API.equipment({ equipment_id: this.value }).then(response => {
        this.list = response.data.list
      })
    }
  }
}
</script>

<style>
</style>
